package com.mes.inventory.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.ForeignKey;
import org.hibernate.annotations.GenericGenerator;

import com.mes.basicdata.domain.Employee;
import com.mes.common.domain.BasicModel;

/**
 * <p>
 * InvWarehouseManager实体，代表库房管理员。
 * </p>
 * author lcs
 * data 2017-03-19
 */
@Entity()
//@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
@Table(name = "I_WAREHOUSEMANAGER")
//@BatchSize(size=10)
//@Lazy(value=true)
//@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class WarehouseKeeper  extends BasicModel implements Serializable {

	// Fields

	@Id
	@GenericGenerator(name = "uniqueId", strategy = "assigned")
	@Column(name = "UNIQUEID")
	private String uniqueId;
	
	@Override
	public String getUuid() {
		return uniqueId;
	}

	@Override
	public void setUuid(String uuid) {
		this.uniqueId = uuid;
	}
	
	public String getUniqueId() {
		return uniqueId;
	}

	public void setUniqueId(String uniqueId) {
		this.uniqueId = uniqueId;
	}
	/**
	 * 复杂对象映射--invWarehouse
	 */
	@Column(name="WAREHOUSEID",length=50)
	protected String warehouseUid;
	//many-to-one
	@ForeignKey(name="null")
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="WAREHOUSEID",insertable=false,updatable=false)
	protected Warehouse warehouse;
	
	/**
	 * 复杂对象映射--Employee
	 */
	@Column(name="EMPLOYEEID",length=100)
	protected String employeeUid;
	//many-to-one
	@ForeignKey(name="null")
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="EMPLOYEEID",insertable=false,updatable=false)
	protected Employee employee;
	
	//protected String duty;
	@Column(name="ISDEFAULT",precision=2,scale=0)
	protected Boolean isDefault;

	// Constructors

	/** default constructor */
	public WarehouseKeeper() {
	}

	/**
	 * 获取库房编号
	 * @return
	 */
	public String getWarehouseUid() {
		return warehouseUid;
	}

	/**
	 * 设置库房编号
	 * @param warehouseUid
	 */
	public void setWarehouseUid(String warehouseUid) {
		this.warehouseUid = warehouseUid;
	}

	/**
	 * 获取库房对象
	 * @return
	 */
	public Warehouse getWarehouse() {
		return warehouse;
	}

	/**
	 * 设置库房对象
	 * @param warehouse
	 */
	public void setWarehouse(Warehouse warehouse) {
		this.warehouse = warehouse;
	}

	/**
	 * 获取人员编号
	 * @return
	 */
	public String getEmployeeUid() {
		return employeeUid;
	}

	/**
	 * 设置人员编号
	 * @param employeeUid
	 */
	public void setEmployeeUid(String employeeUid) {
		this.employeeUid = employeeUid;
	}

	/**
	 * 获取人员对象
	 * @return
	 */
	public Employee getEmployee() {
		return employee;
	}

	/**
	 * 设置人员对象
	 * @param employee
	 */
	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

//	/**
//	 * 获取职责
//	 * @return
//	 */
//	@XmlElement(nillable = false, minOccurs = "0")
//	public String getDuty() {
//		return duty;
//	}
//
//	/**
//	 * 设置职责
//	 * @param duty
//	 */
//	public void setDuty(String duty) {
//		this.duty = duty;
//	}

	/**
	 * 获取默认状态，即是否为默认员工
	 * @return
	 */
	public Boolean getIsDefault() {
		return isDefault;
	}

	/**
	 * 设置默认状态，即是否为默认员工
	 * @param isdefault
	 */
	public void setIsDefault(Boolean isDefault) {
		this.isDefault = isDefault;
	}

}